﻿@namespace SwashbucklerDiary.Components
@inherits MyComponentBase

<div class="my-card-list @(Class)">
    @foreach (var item in Value)
    {
        <DiaryCard Value="item"
                   Class="@CardClass"
                   Privacy="ShowPrivacy"
                   Icon="ShowIcon"
                   OnTag="HandleTag"
                   OnCopy="HandleCopy"
                   OnDelete="OpenDeleteDialog"
                   OnTopping="HandleTopping"
                   OnExport="OpenExportDialog"
                   OnPrivacy="HandlePrivacy"
                   OnClick="HandleClick">
        </DiaryCard>
    }
</div>

<NotFound Show="!Value.Any()" Text="@(NotFoundText ?? I18n.T("Diary.NoDiary"))"></NotFound>

<SelectTags @bind-Value="ShowSelectTag"
@bind-Values="SelectedTags"
            Tags="Tags"
            TagsChanged="TagsChanged"
            OnSave="SaveSelectTags">
</SelectTags>

<DeleteDialog @bind-Value="ShowDeleteDiary"
              Title="@(I18n.T("Diary.Delete.Title"))"
              Content="@(I18n.T("Diary.Delete.Content"))"
              OnOK="()=>HandleDelete(SelectedDiary)">
</DeleteDialog>

<ExportDialog @bind-Value="ShowExport"
              Diaries="ExportDiaries">
</ExportDialog>